(function($) {
    $.fn.table = function(arrH, arrB) {
        var list = [];
        list.push('<table>');
        list.push('<thead>');
        list.push('<tr>');
        for (var i = 0; i < arrH.length; i++) {
            list.push('<th>');
            list.push(arrH[i]);
            list.push('</th>');
        }
        list.push('</tr>');
        list.push('</thead>');
        for (var i = 0; i < arrB.length; i++) {
            list.push('<tr>');
            list.push('<td>' + (i + 1) + '</td>');
            for (var key in arrB[i]) {
                list.push('<td>');
                list.push(arrB[i][key]);
                list.push('</td>');
            }
            list.push('</tr>');
        }
        list.push('</table>');
        this.html(list.join(""));
    }
}(jQuery))